Fk:loadTranslationTable{
  ["dajubei__mingduan"] = "明断",
  [":dajubei__mingduan"] = "出牌阶段限一次，你可以摸一张牌或弃一张牌，然后所有与你手牌数相同的其他角色须进行与你相同的操作。",
  ["#dajubei__mingduan"] = "明断：可以选一张牌弃置，或不选点确定摸一张牌，然后所有与你手牌数相同的其他角色须进行与你相同的操作",

  ["#dajubei__mingduan-discard"] = "明断：须弃置一张牌",
}

local mingduan = fk.CreateSkill{
  name = "dajubei__mingduan",
}

mingduan:addEffect("active", {
  anim_type = "control",
  prompt = "#dajubei__mingduan",
  can_use = function (self, player)
    return player:usedSkillTimes(mingduan.name, Player.HistoryPhase) < 1
  end,
  min_card_num = 0,
  max_card_num = 1,
  card_filter = function (self, player, to_select, selected)
    return #selected == 0
  end,
  target_num = 0,
  target_filter = Util.FalseFunc,
  on_use = function (self, room, effect)
    local to_draw
    if #effect.cards == 1 then
      room:moveCardTo(effect.cards, Card.DiscardPile, nil, fk.ReasonDiscard, mingduan.name, nil, true, effect.from)
    else
      to_draw = true
      effect.from:drawCards(1, mingduan.name)
    end
    if effect.from.dead then return end
    for _, p in ipairs(room:getOtherPlayers(effect.from)) do
      if p:getHandcardNum() == effect.from:getHandcardNum() then
        if to_draw then
          p:drawCards(1, mingduan.name)
        elseif not p:isNude() then
          room:askToDiscard(p, {
            include_equip = true,
            min_num = 1,
            max_num = 1,
            skill_name = mingduan.name,
            cancelable = false,
            prompt = "#dajubei__mingduan-discard",
          })
        end
      end
    end
  end
})

return mingduan